//
//  EaseApplyManager.h
//  ChatDemo
//
//  Created by 度周末网络-王腾 on 15/12/21.
//  Copyright © 2015年 imac. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "InvitationManager.h"

typedef NS_ENUM(NSInteger, ApplyStyle){
    ApplyStyleFriend,
    ApplyStyleGroupInvitation,
    ApplyStyleJoinGroup
};

typedef NS_ENUM(NSInteger, AddFriendStatus){
    // 已经是好友
    DidBuddyExist,
    // 已经发生申请
    HasSendBuddyRequest,
    // 发送申请成功
    SendBuddyRequestSuccess,
    // 发送申请失败
    SendBuddyRequestError,
};

@interface EaseApplyManager : NSObject

+ (instancetype)shareManager;

/**
 *  添加申请消息到本地数据库
 *
 *  @param dictionary
 */
- (void)addNewApply:(NSDictionary *)dictionary;

/**
 *  读取申请消息
 *
 *  @return 消息数组
 */
-(NSArray *)loadApplyFromDB;

/**
 *  添加朋友
 *
 *  @param buddyName 朋友账号
 *
 *  @return 添加朋友的状态值
 */
-(AddFriendStatus)addFriend:(NSString *)buddyName;

/**
 *  接受好友申请，并添加好友
 *
 *  @param entiy 好友
 *
 *  @return 
 */
- (EMError *)applyAddFriend:(ApplyEntity *)entiy;

/**
 *  拒绝好友申请
 *
 *  @param entity 好友
 *
 *  @return
 */
- (EMError *)applyRefuseFriend:(ApplyEntity *)entity;

@end
